﻿<UserControl
    x:Class="PuzzleModern.PulseEffect"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:shapes="using:Windows.UI.Xaml.Shapes"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <UserControl.Resources>
        <Storyboard x:Name="ExpandAndDisappearStoryboard" Completed="ExpandAndDisappearStoryboard_Completed" Duration="0:0:0.3">
            <DoubleAnimation Storyboard.TargetName="Circle"
                             Storyboard.TargetProperty="Opacity"
                             From="1"
                             To="0"
                             EnableDependentAnimation="True"
                             Duration="0:0:0.3"
                             >
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="CircleTransform"
                             Storyboard.TargetProperty="ScaleX"
                             From="0.8"
                             To="1"
                             Duration="0:0:0.3"
                             >
                <DoubleAnimation.EasingFunction>
                    <CircleEase EasingMode="EaseOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="CircleTransform"
                             Storyboard.TargetProperty="ScaleY"
                             From="0.8"
                             To="1"
                             Duration="0:0:0.3"
                             >
                <DoubleAnimation.EasingFunction>
                    <CircleEase EasingMode="EaseOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </UserControl.Resources>

    <Canvas>
        <shapes:Ellipse Margin="-50,-50,0,0" x:Name="Circle" Width="100" Height="100" Stroke="Blue" Opacity="1" RenderTransformOrigin="0.5,0.5" StrokeThickness="4">
            <Ellipse.RenderTransform>
                <CompositeTransform x:Name="CircleTransform" ScaleX="1" ScaleY="1"/>
            </Ellipse.RenderTransform>

        </shapes:Ellipse>
    </Canvas>
</UserControl>
